/*   headers: {
    'Content-Type': 'application/json;charset=UTF-8'
  }, */

import axios from "axios";
import store from "@/store/index.js";
// axios.defaults.headers.post["Content-Type"] = "application/json";
const service = axios.create({
  baseURL: store.state.url,
  headers: {
    "Content-Type": "application/json;charset=UTF-8"
    // "Content-Type": "application/json"
    // "Content-Type": "multipart/form-data;charset=UTF-8"
    // "Content-Type": "application/xml"
  }
});

// service.interceptors.request.use(
//   config => {
//     // config.data = JSON.stringify(config.data);
//     console.log(config.data, 18888);
//     return config;
//   },
//   error => {
//     console.log(error);
//     Promise.reject(error);
//   }
// );

// axios.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
export default service;

// import store from "@/store";
// import axios from "./axios";

// var axios_encrypt = function(url, data) {
//   return new Promise((resolve, reject) => {
//     axios
//       .post(store.state.url + url, data)
//       .then(res => {
//         resolve(res);
//       })
//       .catch(err => {
//         reject(err);
//       });
//   });
// };

// export default axios_encrypt;
